<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>编辑用户</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap-theme.min.css" rel="stylesheet"/>
</head>
<body class="container">
<div class="header">
    <h1 style=" margin-left: 100px">编辑用户</h1>
</div>
<div style="margin-top: 50px">
    <form class="form-horizontal"   th:action="@{/pe/peUserManage/editPeUser}" th:object="${peUser}" method="post" id="form_edit">
        <input type="hidden" name="id" th:value="*{id}"/>
        <div class="form-group">
            <label for="idNumber" class="col-sm-2 control-label">身份证号</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="idNumber"  id="idNumber" th:value="*{idNumber}" placeholder="身份证号"/>
            </div>
        </div>
        <div class="form-group">
            <label for="name" class="col-sm-2 control-label">姓名</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="name"  id="name" th:value="*{name}" placeholder="姓名"/>
            </div>
        </div>
        <div class="form-group">
            <label for="sid" class="col-sm-2 control-label">学号</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="sid"  id="sid" th:value="*{sid}" placeholder="学号"/>
            </div>
        </div>
        <div class="form-group">
            <label for="gender" class="col-sm-2 control-label">性别</label>
            <div class="col-sm-5">
                男<input type="radio"  name="gender"  id="gender" th:value="男" th:checked="${'男'.equals(peUser.getGender())}"/>
                女<input type="radio"  name="gender"  id="gender" th:value="女" th:checked="${'女'.equals(peUser.getGender())}"/>
            </div>
        </div>
        <div class="form-group">
            <label for="age" class="col-sm-2 control-label">年龄</label>
            <div class="col-sm-5">
                <input type="number" class="form-control" name="age"  id="age" th:value="*{age}" placeholder="年龄"/>
            </div>
        </div>
        <div class="form-group">
            <label for="nation" class="col-sm-2 control-label">民族</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="nation"  id="nation" th:value="*{nation}" placeholder="民族"/>
            </div>
        </div>
        <div class="form-group">
            <label for="xueyuan" class="col-sm-2 control-label">学院</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="xueyuan"  id="xueyuan" th:value="*{xueyuan}" placeholder="学院"/>
            </div>
        </div>
        <div class="form-group">
            <label for="banji" class="col-sm-2 control-label">班级</label>
            <div class="col-sm-5">
                <input type="text" class="form-control" name="banji"  id="banji" th:value="*{banji}" placeholder="班级"/>
            </div>
        </div>
        <div class="form-group">
            <label for="phone" class="col-sm-2 control-label">电话</label>
            <div class="col-sm-5">
                <input type="tel" class="form-control" name="phone"  id="phone" th:value="*{phone}" placeholder="电话"/>
            </div>
        </div>
        <div class="form-group">
            <label for="email" class="col-sm-2 control-label">邮箱</label>
            <div class="col-sm-5">
                <input type="email" class="form-control" name="email"  id="email" th:value="*{email}" placeholder="邮箱"/>
            </div>
        </div>
        <div class="form-group">
            <label for="address" class="col-sm-2 control-label">地址</label>
            <div class="col-sm-5">
                <input type="address" class="form-control" name="address"  id="address" th:value="*{address}" placeholder="地址"/>
            </div>
        </div>
        <div class="form-group">
            <label for="role" class="col-sm-2 control-label">授权</label>
            <div class="col-sm-10" th:each="role:${peRoles}">
                <input type="checkbox" name="role" id="role" th:value="${role.id}" th:text="${role.getName()}"
                       th:checked="${peUser.getRolesNames().contains(role.getName()) ? true : false }"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <input type="submit" value="Submit" class="btn btn-info" onclick="f()"/>
                &nbsp; &nbsp; &nbsp;
                <a onclick="javascript:window.history.go(-1)" class="btn btn-info">返回</a>
            </div>
        </div>
    </form>
</div>
</body>
</html>